package cn.quevo.ucenter.server.dao.impl;

import org.springframework.stereotype.Repository;

import cn.quevo.beetlsql.BasicDao;
import cn.quevo.core.exception.CustomException;
import cn.quevo.ucenter.server.dao.OauthCodeDao;
import cn.quevo.ucenter.server.entity.OauthCode;
import cn.quevo.ucenter.server.entity.query.OauthCodeQuery;

/**
 * 授权码Dao接口实现
 * 
 * @author July july_sky@foxmail.com
 * @date 2018年3月26日 下午9:55:44
 * @Copyright ©2015-2035 湘豫(北京)科技有限公司. All Rights Reserved.
 * @version 1.0
 */
@Repository("oauthCodeDao")
public class OauthCodeDaoImpl extends BasicDao<OauthCode, OauthCodeQuery> implements OauthCodeDao {

    private final static String SQL_PRE = "ucenter.server.oauthCode.";

    @Override
    public OauthCode getSinge(OauthCodeQuery oauthCodeQuery) throws CustomException {
        return super.getSinge(oauthCodeQuery, OauthCode.class);
    }

    @Override
    public Integer delete(OauthCode oauthCode) throws CustomException {
        return super.getBeetlSqlFactory().updateObject(SQL_PRE + "delete", oauthCode);
    }

    @Override
    public String getSqlPre() {
        return SQL_PRE;
    }

}
